class UserBankListEntity {
  UserBankListData data;
  int code;
  String msg;

  UserBankListEntity({this.data, this.code, this.msg});

  UserBankListEntity.fromJson(Map<String, dynamic> json) {
    data = json['data'] != null
        ? new UserBankListData.fromJson(json['data'])
        : null;
    code = json['code'];
    msg = json['msg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data']['list'] = this.data.toJson();
    }
    data['code'] = this.code;
    data['msg'] = this.msg;
    return data;
  }
}

class UserBankListData {
  List<UserBankListDataData> datas;

  UserBankListData();

  UserBankListData.fromJson(Map<String, dynamic> json) {
    if (json['list'] != null) {
      datas = new List<UserBankListDataData>();
      (json['list'] as List).forEach((v) {
        datas.add(new UserBankListDataData.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.datas != null) {
      data['list'] = this.datas.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class UserBankListDataData {
// id
// 收货地址ID
// user_id
// 用户ID
// bank_id
// 省份
// bank_name
// 城市
// icon
// 城市
// account
// 详细地址
// company
// 单位名称
// truename
// 收件人
// bg_img
// 联系电话
// postcode
// 邮编
// is_default
// 是否为默认地址 Y是 N否
  String id;
  String user_id;
  String bank_id;
  String bank_name;
  String icon;
  String account;
  String truename;
  String bg_img;
  String is_default;
  UserBankListDataData(
      {this.id,
      this.user_id,
      this.bank_id,
      this.bank_name,
      this.icon,
      this.account,
      this.truename,
      this.bg_img,
      this.is_default});

  UserBankListDataData.fromJson(Map<String, dynamic> json) {
    id = json['id'].toString();
    user_id = json['user_id'].toString();
    bank_id = json['bank_id'].toString();
    bank_name = json['bank_name'];
    icon = json['icon'].toString().replaceFirst(".", "").replaceAll("\\", "/");
    account = json['account'];
    truename = json['truename'];
    bg_img = json['bg_img'];
    is_default = json['is_default'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['user_id'] = this.user_id;
    data['bank_id'] = this.bank_id;
    data['bank_name'] = this.bank_name;
    data['icon'] = this.icon;
    data['account'] = this.account;
    data['bg_img'] = this.bg_img;
    data['truename'] = this.truename;
    data['is_default'] = this.is_default;

    return data;
  }
}